package Teach;

import java.io.File;
import java.io.IOException;

/**
 * description:
 * author:zcx
 * lenovo
 * 时间：2022.01.18.11.53
 */
public class Pj3Copy1 {
    public static void main(String[] args) throws IOException {
        File f = new File("user");
        System.out.println(f.isAbsolute());
        System.out.println(f.isDirectory());
        System.out.println(f.isHidden());
        System.out.println(f.isFile());
        System.out.println(f.exists());

        //建立文件
        File uf1 = new File("user1.txt");
        File uf2 = new File(".","user2.txt");
        System.out.println(uf1.createNewFile());
        System.out.println(uf2.createNewFile());

        //删除文件
        if(uf1.exists()) uf1.delete();
        if(uf2.exists()) uf2.deleteOnExit();

    }

}
